/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.bus.service;

import com.thinkgem.jeesite.modules.bus.dao.StatisticDao;
import com.thinkgem.jeesite.modules.sys.service.AreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * 统计分析Service
 * @author sy
 * @version 2019-06-12
 */
@Service
@Transactional(readOnly = true)
public class StatisticService {

	@Autowired
	private StatisticDao statisticDao;
	@Autowired
	private AreaService areaService;

	/**
	 *
	 * @Title: subsidyStatistic
	 * @author: sy
	 * @date: 2019年06月12日 14:07
	 * @Description: 补助统计
	 * @param year
	 * @return: java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
	 */
	public List<Map<String,String>> subsidyStatistic(String year) {
		List<Map<String,String>> list = statisticDao.subsidyStatistic(year);
		for (Map<String,String> map:list){
			map.put("city",areaService.findAreaByCode(map.get("city")).getName());
			map.put("county",areaService.findAreaByCode(map.get("county")).getName());
		}
		return list;
	}
}